<!DOCTYPE html>
<!--
  ~ Copyright 2009-2015 by WWW.KNET.CN  All rights reserved.
  -->

<html>
<head>
    <title>The Multiple Fields in Column</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../../../bootstrap/2.3.1/css_cerulean/bootstrap.css">
    <link rel="stylesheet" href="../../bootstrap-table.css">
    <script src="../../../jquery/jquery-1.9.1.min.js"></script>
    <script src="../../../bootstrap/2.3.1/js/bootstrap.min.js"></script>
    <script src="../../bootstrap-table.js"></script>
</head>
<body>
    <div class="container">
        <h1>The Multiple Fields in Column(<a href="https://github.com/wenzhixin/bootstrap-table/issues/177" target="_blank">#177</a>.)</h1>
        <table id="table"></table>
    </div>
<script>
    var data = [
        {
            "firstName": "zhixin",
            "lastName": "wen",
            "field1": "field1",
            "field2": "field2",
            "field3": "field3"
        }
    ];

    $(function () {
        $('#table').bootstrapTable({
            data: data,
            columns: [{
                field: 'fullName',
                title: '名称',
                formatter: function (value, row) {
                    var xxx = [row.firstName, row.lastName].join(' ');
                    return xxx;
                }
            }, {
                field: 'field',
                title: '内容',
                formatter: function (value, row) {
                    return [row.field1, row.field2, row.field3].join('+');
                }
            }]
        });
    });
</script>
</body>
</html>